package com.gs.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @ProjectName: springbootmybitstest
 * @Package: com.gs.config
 * @Description: webmvc的配置，可以配置位于本地的资源配置
 * @Author: Administrator
 * @CreateDate: 2018/7/4 16:40
 * @UpdateUser: Administrator
 * @UpdateDate: 2018/7/4 16:40
 * @UpdateRemark: The modified content
 * @Version: 1.0
 **/
@Configuration
public class WebConfig implements WebMvcConfigurer {
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        //配置server虚拟路径，handler为jsp中访问的目录，locations为files相对应的本地路径
        registry.addResourceHandler("/files/**").addResourceLocations("file:D://fileTest/");
       // super.addResourceHandlers(registry);
    }
}
